<div class="layui-form-item layui-form-text">
    <div class="layui-input-block">
        <textarea name="{{ $name??'content' }}" lay-verify="content"  id="{{$id??'L_content'}}" cols="30" rows="10">{{$content??''}}</textarea>
    </div>
</div>

@section('js')
    @parent
    <script>
        layui.config({
            base: '/asset/' //静态资源所在路径
                ,version:true
        }).extend({
            tinymce: '/lib/extend/tinymce/tinymce',
        }).use(['tinymce', 'util', 'layer','form','layedit'], function(){
            var tinymce = layui.tinymce;
            var form = layui.form;
            var editIndex = tinymce.render({
                elem: "#{{$id??'L_content'}}",
                height: {{$height??400}},
                width:'100%',
                padding : 50,
                toolbar:''
            });

            //自定义验证规则
            form.verify({
                content: function(value) {
                    // 将富文本编辑器的值同步到之前的textarea中
                    tinyMCE.editors['{{$id??"L_content"}}'].save();
                }
            });
        });
    </script>
@endsection